package cn.bsb.service.backstage;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.bsb.dao.thematicMapper;
import cn.bsb.pojo.Thematic;

@Service
public class ThematicService {
	@Autowired
	private thematicMapper thematic;
	
	public List<Thematic> getThematicList(){
		return thematic.getAllList();
	}
	
	//ר���б�
	public PageInfo<Thematic> getAllList(int pageNum, int pageSize){
		//��ҳ������з�ҳ
		PageHelper.startPage(pageNum, pageSize);
		List<Thematic> list = thematic.getAllList();
		PageInfo<Thematic> page = new PageInfo<Thematic>(list);
		return page;
	}
	//��ѯ���ר���б�
	public List<Thematic> getList(String name){
		List<Thematic> list = thematic.getList(name);
		return list;
	}
	//���ҵ�һ��ר�����Ϣ
	public Thematic getOne(Long id) {
		return thematic.getOne(id);
	}
	//���һ��
	public int addThematic(String name,Long createId) {
		return thematic.addThematic(name, createId);
	}
	//�޸�ר��
	public int updateThematic(Long id,String name,Long modifyId) {
		return thematic.updateThematic(id, name, modifyId);
	}
	//删除专题
	public int deleteThematic(Long id) {
		return thematic.deleteThematic(id);
	}
}
